package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysCodeDAO;
import com.pmh.hrs.sys.service.SysCodeService;
import com.pmh.hrs.sys.vo.SysCodeVO;

@Service("sysCodeService")
public class SysCodeServiceImpl implements SysCodeService{

	@Resource(name="sysCodeDAO")
	private SysCodeDAO sysCodeDAO;
	
	
	private SysCodeVO convertSysCodeVO(Map<String,Object> paramMap) throws Exception{
		SysCodeVO sysCodeVO = new SysCodeVO();
		BeanUtils.copyProperties(paramMap, sysCodeVO);
		return sysCodeVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysCodeVO sysCodeVO =  this.convertSysCodeVO(paramMap);
		return sysCodeDAO.insert(sysCodeVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysCodeVO sysCodeVO =  this.convertSysCodeVO(paramMap);
		return sysCodeDAO.update(sysCodeVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysCodeDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysCodeDAO.selectList(paramMap);
	}

}
